<!DOCTYPE html>
<html>
<head>
    <title>模具维护计划</title>
    #parse("sys/header.html")
    <style>
        .ui-jqgrid {
            width: 100%;
            float: right;
        }
        textarea.ivu-input {
            max-width: 85%;
        }
        .ivu-form-item {
            margin: 20px 0 0 0;

        }
        .leftHeight{
            height: 85vh;
            overflow: auto;
        }
        ::-webkit-scrollbar{
            width: 10px;
            height: 10px;
        }
        ::-webkit-scrollbar-thumb{
            border-radius: 10px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: #a8a5a5;
        }
        .workShop{
            position: absolute;
            top: 0;
            width: 100%;
            height: 25px;
            z-index: 999;
            background-color: white;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>

    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"></i-input>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.moduleNo" @on-enter="query" placeholder="模具号"></i-input>
                </i-col>
                <i-col span="4">
                    <i-select v-model="q.progress" placeholder="计划状态">
                        <i-option v-for="item in reviewStatus" :value="item.value" :key="item.value">{{item.name}}</i-option>
                    </i-select>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("modulemaintainplan:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("modulemaintainplan:save"))
                <i-button type="info" @click="commit"><i class="fa fa-upload"></i>&nbsp;提交审核</i-button>
                #end

                #if($shiro.hasPermission("modulemaintainplan:goOptionList"))
                <i-button type="info" @click="goOptionList"><i class="fa fa-bars"></i>&nbsp;添加规程选项</i-button>
                #end

                #if($shiro.hasPermission("modulemaintainplan:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end

                <!--#if($shiro.hasPermission("modulemaintainplan:isSure"))
                <i-button type="info" @click="isSure"><Icon type="checkmark-round"></Icon>&nbsp;效果确认</i-button>
                #end

                #if($shiro.hasPermission("modulemaintainplan:isOutTime"))
                <i-button type="warning" @click="isOutTime"><Icon type="clipboard"></Icon>&nbsp;延期申请</i-button>
                #end
                #if($shiro.hasPermission("modulemaintainplan:start"))
                <i-button type="success" @click="start"><Icon type="arrow-right-b"></Icon>&nbsp;开始执行</i-button>
                #end
                #if($shiro.hasPermission("modulemaintainplan:error"))
                <i-button type="error" @click="error"><Icon type="trash-b"></Icon>&nbsp;异常上报</i-button>
                #end
                #if($shiro.hasPermission("modulemaintainplan:dealError"))
                <i-button type="error" @click="dealError"><Icon type="trash-b"></Icon>&nbsp;异常处理</i-button>
                #end-->

                #if($shiro.hasPermission("modulemaintainplan:approval"))
                <i-button type="info" @click="approval"><Icon type="edit"></Icon>&nbsp;审核</i-button>
                #end
                #if($shiro.hasPermission("modulemaintainplan:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
                #if($shiro.hasPermission("modulemaintainplan:end"))
                <i-button type="primary" @click="end"> <Icon type="wrench"></Icon>&nbsp;计划完成</i-button>
                #end
                #if($shiro.hasPermission("modulemaintainplan:end"))
                <i-button type="primary" @click="endPlan"> <Icon type="wrench"></Icon>&nbsp;终止计划</i-button>
                #end
            </div>
        </Row>

        <Row  :gutter="16" style="margin: 8px 0px 0px 1px;">
            <i-col :xs="3" :sm="3" :md="2" :lg="3">
                <div class="leftHeight" >
                    <div class="workShop">
                        <p class="text-center" style="font-size: 15px;">模具类型</p>
                    </div>
                    <div id="storeLayer" style="margin-top: 25px">
                        <ul id="typeTree" class="ztree"></ul>
                    </div>
                </div>
            </i-col>
            <i-col :xs="21" :sm="21" :md="21" :lg="21">
                <table  id="jqGrid"></table>
            </i-col>
        </Row>
    </div>
    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="moduleMaintainPlan" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="11" v-if="!moduleMaintainPlan.id">
                    <Form-item label="计划名称" prop="planName">
                        <i-input v-model="moduleMaintainPlan.planName" placeholder="计划名称" readonly></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="模具号" prop="moduleNo">
                        <i-input v-model="moduleMaintainPlan.moduleNo" placeholder="模具号"
                                 icon="md-arrow-dropdown-circle" @on-click="getModuleBase" readonly></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="开始时间" prop="planStartDate">
                        <Date-picker type="date" format="yyyy-MM-dd" v-model="moduleMaintainPlan.planStartDate" placeholder="计划开始时间"></Date-picker>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="结束时间" prop="planEndDate" offset="1">
                        <Date-picker type="date" format="yyyy-MM-dd" v-model="moduleMaintainPlan.planEndDate" placeholder="计划结束时间"></Date-picker>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="备注" prop="remark">
                        <i-input type="textarea" v-model="moduleMaintainPlan.remark" placeholder="备注"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">
                返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
    <div id="appv"  style="display: none;">
        <i-form :model="approveParam" :label-width="100">
            <Form-item label="审批状态" prop="status">
                <Radio-group v-model="approveParam.status">
                    <Radio :label="1"><span>通过</span></Radio>
                    <Radio :label="2"><span>未通过</span></Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="备注信息" prop="remark">
                <i-input type="textarea" v-model="approveParam.remark" placeholder="请输入备注信息"></i-input>
            </Form-item>
        </i-form>
    </div>

    <div id="remark_div"  style="display: none;">
        <br/>
        如果是延期计划结束，请录入延期原因！
        <br/>
        <i-input type="textarea" v-model="remark2" placeholder="请输入备注信息"></i-input>
    </div>

    <div id="dealError"  style="display: none;">
        <i-form :model="moduleError" :label-width="100">
            <i-col>
                <Form-item label="处理意见" prop="dealOpinion">
                    <i-input type="textarea" v-model="moduleError.dealOpinion" placeholder="处理意见"></i-input>
                </Form-item>
            </i-col>

        </i-form>
    </div>
</div>

<script src="${rc.contextPath}/js/module/modulemaintainplan.js?_${date.systemTime}"></script>
</body>
</html>
